<!DOCTYPE html>
<html lang="ja">
<head>
	<meta charset="UTF-8">
	<title>買い物カゴ | デンタルダイヤモンド社</title>
	<meta name="description" content="デンタルダイヤモンド社 :: 月刊デンタルダイヤモンド、DH Styleをはじめ、様々な書籍の情報閲覧が可能です。またその場で購入ができるオンラインショッピングも充実しております。">
	<meta name="keywords" content="補綴,咬合,有床義歯,クラウンブリッジ,インプラント,保存修復,歯内療法,歯周治療,歯科矯正,口腔外科,口腔診断,歯科X線,全身管理,予防歯科,高齢者歯科,若手歯科医のための臨床の技,月刊,チェアーサイドのガイドブック,ポケットブック,医事,経営,社会保険,スタッフ教育,待合室・患者指導用絵本,診療説明用リーフレット,デンタル,ダイヤモンド,デンタルダイヤモンド,歯学書,歯科">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<meta name="format-detection" content="telephone=no">
	<link rel="apple-touch-icon" href="sp/assets/images/icons/ip_icon.png">

	<!-- stylesheets -->
	<link rel="stylesheet" href="sp/assets/css/main.css" media="screen">
	<link rel="stylesheet" href="sp/assets/css/print.css" media="print">

	<!-- javascript -->
	<script src="sp/assets/js/func.js" type="text/JavaScript"></script>
	<script src="sp/assets/js/openclose.js" type="text/Javascript"></script>
	<script src="sp/assets/js/search_txt.js" type="text/Javascript"></script>
	<script src="sp/assets/js/jquery-1.7.2.js" type="text/javascript"></script>
	<script src="/__utm.js" type="text/javascript"></script>
<script type="text/javascript">
    function parseNum(s)
    {
        s = String(s);
        return Number(s.replace(",", ""));
    }

    function formatNum(strNum)
    {
        strNum = String(strNum);
        if (strNum.length <= 3) {

            return strNum;

        }

        if (!/^(\+|-)?(\d+)(\.\d+)?$/.test(strNum)) {

            return strNum;

        }

        var a = RegExp.$1, b = RegExp.$2, c = RegExp.$3;

        var re = new RegExp();

        re.compile("(\\d)(\\d{3})(,|$)");

        while (re.test(b)) {

            b = b.replace(re, "$1,$2$3");

        }
        return a + "" + b + "" + c;

    }
function changeNum(goodid)
{

	changecart();
}
function changecart()
{

	var temp_shopjp_cart="";
	for(var i=0;i<Number($("#rowbody").attr("rowcount"));i++)
	{
		if($("#tr_"+i).length>0)
		{
			var gid=$("#tr_"+i).attr("goodid");
			var gnum=$("#orderNum_"+i).val();
			if(temp_shopjp_cart=="")
			{
				temp_shopjp_cart=gid+"-"+gnum;
			}
			else
			{
				temp_shopjp_cart =temp_shopjp_cart+"|"+gid+"-"+gnum;
			}
			$("#errmsg_"+gid).html("");
		}
	}
	$.ajax({url:"{{'sp/Cart/ajaxsetcart'|U}}",type:"POST",async:false,data: "shopjpcart="+temp_shopjp_cart,
		success: function(msg){
		     if(msg!="cart ajax success")
		    	 {
		    	 eval(msg);
		    	 }
		     	else
		    	 {

		    		refreshSum();
		    	 }
		   },
			error:function()
			{
				eval(msg);
			}
	})
	return true;

}

function deleterow(id)
{

	 $('#tr_'+id).remove();
	 $('#trnum_'+id).remove();
 	 $('#tsum_'+id).remove();
	 $('#trctrl_'+id).remove();
	 if(changecart())
	 {
 		refreshSum();
	 }
}

function refreshSum() {
    var sumprice = 0;
    var count = 0;
    for (var i = 0; i < Number($("#rowbody").attr("rowcount")); i++) {

        if ($("#sumPrice_" + i).length > 0) {
            count++;
        }
        $("#sumPrice_" + i).html(formatNum(parseNum($("#price_" + i).html()) * parseNum($("#orderNum_" + i).val())));
        sumprice += parseNum($("#sumPrice_" + i).html());

    }
    $("#allSumPrice").html(formatNum(sumprice));
    $("#orderSumPrice").html(formatNum(parseNum($("#allSumPrice").html())));
    if (count == 0) {
        $("[nogoods='hide']").hide();
        $("#nogood_msg").html("カゴの中には何もはいっていません");
    }
}

</script>
</head>

<body>
	<div id="wrapper">
		 {{$sp_head}}
<center><span style="color:red;">{{$errmsg}}</span></center>
		<ol id="pan">
			<li><a href="{{'sp/Top/index'|U}}">ホーム</a></li>
			<li>買い物カゴ</li>
		</ol>

		<section id="main">
			<div id="cart">
				<h1>買い物カゴ</h1>

				<ul>
					<li>ご注文いただいた商品を表示しています。</li>
					<li>買い物に戻る場合は、【お買い物に戻る】ボタンを押してください。</li>
					<li>数量を変更する場合は、数量入力エリアに数量を入力して入力フォームの横の  ボタンを押してください。</li>
					<li>ご注文をされる場合は、【お会計に進む】ボタンでご注文手続きを開始してください。</li>
				</ul>

				<h2>ご注文内容</h2>
				<form name="cart" id="form_cart" action="/shop/cart/" method="post" target="_top">
					<div id="cart_detail">
					<span id="nogood_msg"></span>
						<table border="0" cellpadding="0" cellspacing="1" nogoods='hide'>
							<tbody id="rowbody" rowcount="{{$good_data|@count}}">
							{{foreach name=goodloop from=$good_data item=i}}
								<tr  id="tr_{{$smarty.foreach.goodloop.index}}" goodid="{{$i.id}}">
									<th>商品名</th>
									<td class="goods">
										<a href=""><img src="sp/images/{{$i.goods_image}}" alt="{{$i.goods_name}}"></a>
										<a href="">{{$i.goods_name}}</a><br>
										<p class="price">¥<span id="price_{{$smarty.foreach.goodloop.index}}" >{{$i.goods_unitprice|number_format}}</span></p>
									</td>
								</tr>
								<tr  id="trnum_{{$smarty.foreach.goodloop.index}}">
									<th>数量</th>
									<td align="center">
										<input type="text" id="orderNum_{{$smarty.foreach.goodloop.index}}"  value="{{$i.orderNum}}" size="3">
										<input type="image"  onclick="changeNum({{$smarty.foreach.goodloop.index}});return false;" id="btn_reload-cart496" name="selectMethod[update]" src="sp/assets/images/btns/btn_cart_reload.gif" width="22" height="22" title="このボタンをクリックするとカーとの中身を更新します" align="absmiddle">
										<br><span  style="color:red;" id="errmsg_{{$i.id}}"></spans>
									</td>
								</tr>
								<tr id="tsum_{{$smarty.foreach.goodloop.index}}">
									<th>小計</th>
									<td class="price">¥<span id="sumPrice_{{$smarty.foreach.goodloop.index}}">{{$i.orderNum*$i.goods_unitprice|number_format}}</span></td>
								</tr>
								<tr id="trctrl_{{$smarty.foreach.goodloop.index}}">
									<th class="delete"></th>
									<td class="delete">
									<!-- <input type="checkbox" id="chk_{{$smarty.foreach.goodloop.index}}"  value="1" align="absmiddle"> -->
									<input name="selectMethod[update]" onclick="deleterow('{{$smarty.foreach.goodloop.index}}');return false;" type="image" src="sp/assets/images/btns/btn_cart_delete.gif" alt="チェックした商品を全て削除" align="absmiddle" width="43" height="23">
									</td>
								</tr>
									{{/foreach}}
							</tbody>
							<tfoot>
								<tr>
									<td class="txt">商品合計</td>
									<td class="price">¥<span id="allSumPrice"></span></td>
								</tr>
								<tr>
									<td class="txt">送料(手数料)</td>
									<td class="price">別途</td>
								</tr>
								<tr>
									<td class="txt2">合計額</td>
									<td class="price2">¥<span id="orderSumPrice"></span></td>
								</tr>
							</tfoot>
						</table>

						<dl>
							<dd><input nogoods='hide' type="button" name="selectMethod[next]" onclick="location.href='{{'sp/Order/index'|U}}'" title="お会計に進む"></dd>
							<dt><a href="{{'sp/Top/index'|U}}" onClick="" title="お買い物に戻る">お買い物に戻る</a></dt>
						</dl>
						<br clear="all">
						<script type="text/javascript">refreshSum();</script>
					</div>
				</form>
			</div>

			<div id="cart_recommend">
				<h3 class="cart_recommend">あなたにおすすめの書籍</h3>
				  <script language="JavaScript" type="text/javascript" charset="UTF-8">script = document.createElement("script");script.setAttribute("type", "text/javascript");script.setAttribute("language", "JavaScript");script.setAttribute("charset", "UTF-8");script.setAttribute("src", document.location.protocol + "//rc.kotoha.co.jp/js/kotohaco_rsWidget.js");tmp = document.createElement("div");tmp.appendChild(script);document.write(tmp.innerHTML);</script><script language="JavaScript" type="text/javascript" charset="UTF-8">var queryopt = new Array();
                        //レコメンド方式: 関連商品(タイプ2)
                        //itemidを指定します。指定されたitemidの商品に関連する商品を表示します。itemidはセミコロン区切りで最大10件まで設定可能です。 
                        //例：itemid = "X490352;X490863";
                        itemid = "200339";

                        k_callRs("dental-diamond","kotohaco_recoview","relation2",'itemid='+itemid,rsView,{ "layout": "table|cols=5|rows=1", "maxitems": "10", "pagenav": "1", "viewitems": ["image|type=image|link=1|size=0|alt=title", "title|type=text|link=1|maxlen=0", "data1|type=text|link=0|maxlen=0", "itemid|type=text|link=0|maxlen=0"], "link_target": "", "replaceprotocol_link": "1", "replaceprotocol_image": "1"},[[".kotohaco_rsview_itemwindow table td", "width:20%;height:100%;"], [".kotohaco_rsview_itemwindow ol", "margin:0; padding:0;list-style-type:none;width:100%;"], [".kotohaco_rsview_itemwindow table", "width:100%;"], [".kotohaco_rsview_item", "text-align:center; vertical-align: top; padding: 5px;"], [".kotohaco_rsview_item div", "margin-bottom:2px 0px;"], [".kotohaco_rsview_title", "border-bottom: medium #CCCCCC solid; border-left: thick #CCCCCC solid; padding: 5px; margin: 5px 0px;"], [".kotohaco_rsview_footer", "border-top: thin #CCCCCC solid; padding: 2px; font-size:10px; text-align:right; margin: 2px 0px;clear:both;"], [".kotohaco_rsview_pagenav .pagenav_back", "float:left; text-align:left"], [".kotohaco_rsview_pagenav .pagenav_next", "float:right; text-align:right"], [".kotohaco_rsview_pagenav", "text-align:center; clear:both;"]],queryopt);
                        </script>
				<br clear="all" />
			</div>
		</section>

		<section id="r_clm">
			<h3>3,000円以上で送料無料</h3>

			<h4><a href="javascript:collapse.slideit()">カテゴリ</a></h4>
	       {{$categorying}}

			<h4><a href="javascript:collapse2.slideit()">Information</a></h4>
			<ul id="info">
				<li><a href="">ご利用案内</a></li>
				<li><a href="">求人案内</a></li>
				<li><a href="">図書取扱店</a></li>
				<li><a href="">トピックス</a></li>
				<li><a href="">販売支援</a></li>
				<li><a href="">会社概要</a></li>
				<li><a href="">お問い合せ</a></li>
			</ul>

        {{$chartsing}}
		</section>
		<br clear="all">

		{{$sp_foot}}
	</div>

<script type="text/javascript">
	var collapse = new animatedcollapse("cat", 400, true,"block");
	var collapse2 = new animatedcollapse("info", 400, true,"block");
	var collapse3 = new animatedcollapse("ranking", 400, true,"block");
	var collapse4 = new animatedcollapse("whatsnew", 400, true,"block");
</script>
</body>
</html>